/**
 * Store Group information
 */
Ext.define('Cps.model.Group', {
	extend: 'Ext.data.Model',
	fields: [ 
	    'name', 'user_id'
	],
	
	belongsTo: 'Cps.data.User',
	
	hasMany: [{ 
		model: 'Cps.model.Company', 
		name: 'companies',
		foreignKey: 'group_id',
		associationKey: 'companies'
	}],
	
	proxy: { //CRUD
		type: 'rest',
		url: Cps.Config.Api.group,
		reader: {
			type: 'json',
			root: 'groups'
		}
	}
});